<template>
    <div class="main">
      <section>

        <div class="search-bar">
          <div class="form-item">
            <span class="item-title">开始日期</span>
            <el-date-picker
              v-model="params.startDate"
              type="date"
              placeholder="选择日期"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd">
            </el-date-picker>
          </div>
          <div class="form-item">
            <span class="item-title">结束日期</span>
            <el-date-picker
              v-model="params.endDate"
              type="date"
              placeholder="选择日期"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd">
            </el-date-picker>
          </div>
          <div class="form-item col-1">
            <el-button type="primary" icon="el-icon-search" @click="startFixed">确定</el-button>
          </div>
        </div>
      </section>
    </div>
</template>

<script>
    export default {
      name: "orderFixed",
      data() {
        return {
          params: {
            startDate: '',
            endDate: ''
          }

        }
      },
      methods: {
        startFixed() {
          if(!this.params.startDate){
            this.$message({
              message: '开始时间不能为空',
              type: 'error'
            })
            return false
          }
          if(!this.params.endDate){
            this.$message({
              message: '结束时间不能为空',
              type: 'error'
            })
            return false
          }
          this.request({
            url: '/order-status/check',
            method: 'post',
            data: this.params
          }).then(res => {
            this.$message({
              type:'success',
              message: res.message || res.msg
            })
          }).catch(e => {
            this.$message({
              type:'error',
              message: '失败'
            })
          })
        }
      }
    }
</script>

<style scoped>

</style>
